"""
学习能力强 计算资源消耗大
"""
from sklearn.datasets import fetch_california_housing
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import cross_val_score

x, y = fetch_california_housing(return_X_y=True)
print(x.shape)

NN = MLPRegressor(hidden_layer_sizes=(100, ), random_state=22)  # 0.838
NN = MLPRegressor(hidden_layer_sizes=(100, 100), random_state=22)  # 3.42
NN = MLPRegressor(hidden_layer_sizes=(150,), random_state=22)  # 1.37
NN = MLPRegressor(hidden_layer_sizes=(50,), random_state=22)  # 0.686
NN = MLPRegressor(hidden_layer_sizes=(16,), random_state=22)  # 0.646

loss = -cross_val_score(NN, x, y, cv=5, scoring='neg_mean_squared_error').mean()
print(loss)

